package com.alks.function.mapper;

import com.alks.entity.data.entity.QuotationMaster;
import com.alks.entity.data.entity.QuotationTypeDetail;
import com.alks.function.data.request.quotation.DeleteQuotationDetailRequest;
import com.alks.function.data.request.quotation.IQuotationDetailRequest;
import com.alks.function.data.request.quotation.QuotationTypeDetailRequest;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.mapstruct.Mapper;

import java.math.BigDecimal;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;

@Mapper
public interface QuotationTypeDetailMapper extends BaseMapper<QuotationTypeDetail> {
    List<Map<String, BigDecimal>> getTotalAmtUSD(IQuotationDetailRequest request);

    List<Map<String, BigDecimal>> getTotalAmtRMB(IQuotationDetailRequest request);

    BigDecimal getRate();
    @Select("SELECT MTL_NO FROM PC_MTL_ACC WHERE MTL_NAME = #{name}  AND MTL_COLOR = #{color}")
    String getMtlNo(@Param("name") String name,@Param("color") String color);

    List<String> getMtlProperty();

    List<String> getCurrency();

    Integer deleteQuotationDetails(DeleteQuotationDetailRequest request);

    Long getQuotationDetailTotal(QuotationTypeDetailRequest request);

    List<QuotationMaster> getInQuotationBom(@Param("styleNo") String styleNo,@Param("styleColor") String styleColor);



    List<String> getAttach();


    void insertList(@Param("quotation") List<QuotationMaster> quotations,@Param("slipNo") String slipNo);

    void insertAttach(@Param("maps") ArrayList<Map> maps);

    @Select("SELECT  COUNT(*) FROM YF_STYLE_COST WHERE STYLE = #{style} AND SLIP_NO = #{slipNo}")
    Integer selectListDetail(@Param("slipNo") String slipNo,@Param("style") String style);
}
